(function ($) {
	mui.init()
	mui.plusReady(function() {
		//header状态栏
		plus.screen.lockOrientation("portrait-primary")
		var imghead = mui("#imghead")[0]
		const loginInfo = app.getState();
		var name = loginInfo.loginName
		if (name.length > 2) {
			name = name.substring(name.length-2,name.length)
		}
		imghead.setAttribute('data-name',name)
		var photo = loginInfo.PerPic
		if (photo && photo!="") {
			imghead.innerHTML = '<img src="'+photo +'" />'
			mui("#imghead img")[0].addEventListener('error',function(){
				var parentNode = this.parentNode
				parentNode.innerHTML = parentNode.getAttribute('data-name')
				parentNode.removeAttribute('style')
			})
		}else{
			imghead.innerHTML = name
			imghead.removeAttribute('style')
		}
		
		mui('#userName')[0].innerText = loginInfo.loginName;
		mui('#userLoc')[0].innerText = loginInfo.loginWardDesc;
		if (!loginInfo.Qrcode || loginInfo.Qrcode == "") {
			mui.toast('暂无二维码信息')
			return
		}
		var qrcode = new QRCode(mui('#qrcode')[0], {
			width : 140 / SCALE,
			height : 140 / SCALE
		});
		qrcode.makeCode(loginInfo.Qrcode);
	})
})(mui)